let {messageTable}=require("./messageTable")

module.exports={
    getMessage(req,res){
        let {msg,userName}=req.body
        // console.log(msg,userName)
        messageTable
            .create({
                say:String(msg),
                name:String(userName)
            }).then(()=>{
                res.send({
                    code:200,
                    msg:"发表成功"
                })
            }).catch(()=>{
                res.send({
                    code:500,
                    msg:"服务器错误"
                })
            })
    }
}